#include <iostream>

using namespace std;
char numOne[10][5]={"XXX","..X","XXX","XXX","X.X","XXX","XXX","XXX","XXX","XXX"};
char numTwo[10][5]={"X.X","..X","..X","..X","X.X","X..","X..","..X","X.X","X.X"}; 
char numSan[10][5]={"X.X","..X","XXX","XXX","XXX","XXX","XXX","..X","XXX","XXX"};
char numFou[10][5]={"X.X","..X","X..","..X","..X","..X","X.X","..X","X.X","..X"};
char numFiv[10][5]={"XXX","..X","XXX","XXX","..X","XXX","XXX","..X","XXX","XXX"};
 
int main(){
	int n;
	char s[105]={0};
	cin>>n;
	cin>>s;
	for(int i=0;i<n;i++){
		if(i!=0){
			cout<<"."<<numOne[s[i]-'0'];
		}else{
			cout<<numOne[s[i]-'0'];
		}
	}
	cout<<endl;
	for(int i=0;i<n;i++){
		if(i!=0){
			cout<<"."<<numTwo[s[i]-'0'];
		}else{
			cout<<numTwo[s[i]-'0'];
		}
	}
	cout<<endl;
	for(int i=0;i<n;i++){
		if(i!=0){
			cout<<"."<<numSan[s[i]-'0'];
		}else{
			cout<<numSan[s[i]-'0'];
		}
	}
	cout<<endl;
	for(int i=0;i<n;i++){
		if(i!=0){
			cout<<"."<<numFou[s[i]-'0'];
		}else{
			cout<<numFou[s[i]-'0'];
		}
	}
	cout<<endl;
	for(int i=0;i<n;i++){
		if(i!=0){
			cout<<"."<<numFiv[s[i]-'0'];
		}else{
			cout<<numFiv[s[i]-'0'];
		}
	}
	return 0;
}
